<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp" %>    
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><spring:message code="message.lable.proddruginfoAuditSTDcheck"/></title>
<%@ include file="/WEB-INF/component/commonCSS.jsp" %> 
 <style type="text/css">
    div.col-sm-4.text-left,div.col-sm-9.text-left{
    color:#949494;
    }	
    </style>

</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1><spring:message code="message.lable.proddruginfoAuditSTDcheck"/></h1>
        <ol class="breadcrumb">
             <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.StdManage"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.proddruginfoStd"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.proddruginfoAuditSTDcheck"/></a></li>
        </ol>
    </section>
    <section class="content">
        <div class=" box box-success">
            <form  id="form1" class="form-horizontal" action="" method="post">
                <input type="hidden" name="prodId" value="${detail.prodId}" />
                <input type="hidden" name="opType" value="${opType}" />
                 <input type="hidden" name="status" value="${detail.status}" /> 
                <div class="box-body">              
                    <div class="form-group form-group-xs">
                        <label class="col-sm-2 text-right"><spring:message code="message.listForm.yaoPinBianMa"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <c:out value="${detail.drugCode}" />
                        </div>
                        
                        <label class="col-sm-3 text-right"><spring:message code="message.listForm.tongYongMing"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <c:out value="${detail.qualityspecName}" />
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="form-group form-group-xs">
                        <label class="col-sm-2 text-right"><spring:message code="message.listForm.tongYongMingEnglish"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <c:out value="${detail.qualityspecNameEng}" />
                        </div>
                        
                        <label class="col-sm-3 text-right"><spring:message code="message.listForm.shangPinMing"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <c:out value="${detail.busName}" />
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="form-group form-group-xs">
                        <label class="col-sm-2 text-right"><spring:message code="message.listForm.jiXing"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <c:out value="${detail.formName}" />
                        </div>
                        
                        <label class="col-sm-3 text-right"><spring:message code="message.listForm.guiGe"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <c:out value="${detail.specName}" />
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="form-group form-group-xs">
                        <label class="col-sm-2 text-right"><spring:message code="message.listForm.zhuanHuanXiShu"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <c:out value="${detail.factor}" />
                        </div>
                        
                        <label class="col-sm-3 text-right"><spring:message code="message.listForm.danWei"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <c:out value="${detail.unitName}" />
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="form-group form-group-xs">
                        <label class="col-sm-2 text-right"><spring:message code="message.listForm.caiZhi"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <c:out value="${detail.materialName}" />
                        </div>
                        
                        <label class="col-sm-3 text-right"><spring:message code="message.listForm.yaoPinBenWeiMa"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <c:out value="${detail.drugStdCode}" />
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="form-group form-group-xs">
                        <label class="col-sm-2 text-right"><spring:message code="message.listForm.piZhunWenHao"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <c:out value="${detail.approvalCode}" />
                        </div>
                        
                        <label class="col-sm-3 text-right"><spring:message code="message.listForm.piZhunRiQi"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <c:out value="${detail.approvalDate}" />
                        </div>
                    </div>
                   <div class="line"></div>
                    <div class="form-group form-group-xs">
                        <label class="col-sm-2 text-right"><spring:message code="message.listForm.jiBenYaoWuShuXing"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <c:if test="${detail.drugAttr == 1}"><spring:message code="message.listForm.guoJiaJiBenYaoWu"/></c:if>
                            <c:if test="${detail.drugAttr == 2}"><spring:message code="message.listForm.shengZengBuJiBenYaoWu"/></c:if>
                            <c:if test="${detail.drugAttr == 3}"><spring:message code="message.listForm.qiTa"/></c:if>
                        </div>
                        
                        <label class="col-sm-3 text-right"><spring:message code="message.listForm.jiYaoXuHao"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <c:out value="${detail.drugIndex}" />
                        </div>
                    </div>
                    <div class="line"></div>    
                   <div class="form-group form-group-xs">
                      <label class="col-sm-2 text-right"><spring:message code="message.listForm.YaoLiFenLei"/><spring:message code="message.yanZheng.maoHao"/></label>
                      <div class="col-sm-3 text-left">
                            <c:out value="${detail.pharName}" />
                       </div>
                      
                       <label class="col-sm-3 text-right"><spring:message code="message.listForm.zhuanLiLeiXing"/><spring:message code="message.yanZheng.maoHao"/></label>
                       <div class="col-sm-3 text-left">
                            <c:if test="${detail.patternType == 1}"><spring:message code="message.listForm.faMingZhuanLi"/></c:if>
                            <c:if test="${detail.patternType == 2}"><spring:message code="message.listForm.shiYongXinXingZhuanLi"/></c:if>
                            <c:if test="${detail.patternType == 3}"><spring:message code="message.listForm.waiGuanSheJiZhuanLi"/></c:if>
                            <c:if test="${detail.patternType == 4}"><spring:message code="message.listForm.meiYouZhuanLi"/></c:if>
                            <c:if test="${detail.patternType == 9}"><spring:message code="message.listForm.buXiang"/></c:if>
                       </div>
                   </div>
                   <div class="line"></div>   
                   <div class="form-group form-group-xs">
                        <label class="col-sm-2 text-right"><spring:message code="message.listForm.yaoPinLaiYuan"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <c:if test="${detail.drugSource == 1}"><spring:message code="message.listForm.guoChan"/></c:if>
                            <c:if test="${detail.drugSource == 2}"><spring:message code="message.listForm.jinKou"/></c:if>
                            <c:if test="${detail.drugSource == 9}"><spring:message code="message.listForm.buXiang"/></c:if>
                        </div>
                        
                        <label class="col-sm-3 text-right"><spring:message code="message.listForm.shiFouDiJiaYao"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <c:if test="${detail.isLowprice == 0}"><spring:message code="message.listForm.fou"/></c:if>
                            <c:if test="${detail.isLowprice == 1}"><spring:message code="message.listForm.shi"/></c:if>
                            <c:if test="${detail.isLowprice == 9}"><spring:message code="message.listForm.WeiZhi"/></c:if>
                        </div>
                   </div>
                   <div class="line"></div>     
                   <div class="form-group  form-group-xs">
                        <label class="col-sm-2 text-right"><spring:message code="message.listForm.shiFouNongHe"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <c:if test="${detail.isAgriculture == 0}"><spring:message code="message.listForm.fou"/></c:if>
                            <c:if test="${detail.isAgriculture == 1}"><spring:message code="message.listForm.shi"/></c:if>
                            <c:if test="${detail.isAgriculture == 9}"><spring:message code="message.listForm.WeiZhi"/></c:if>
                         </div>
                         
                         <label class="col-sm-3 text-right"><spring:message code="message.listForm.shiFouYiBao"/><spring:message code="message.yanZheng.maoHao"/></label>
                         <div class="col-sm-3 text-left">
                            <c:if test="${detail.isHealthcare == 0}"><spring:message code="message.listForm.fou"/></c:if>
                            <c:if test="${detail.isHealthcare == 1}"><spring:message code="message.listForm.shi"/></c:if>
                            <c:if test="${detail.isHealthcare == 9}"><spring:message code="message.listForm.WeiZhi"/></c:if>
                         </div>
                    </div>
                      <div class="line"></div>  
                     <div class="form-group form-group-xs">
                          <label class="col-sm-2 text-right"><spring:message code="message.listForm.yaoPinBenWeiMaBeiZhu"/><spring:message code="message.yanZheng.maoHao"/></label>
                          <div class="col-sm-3 text-left">
                               <c:out value="${detail.drugStdcdRemark}" />
                          </div>
                     </div>
                     <div class="line"></div>
                     <div class="form-group form-group-xs">
                          <label class="col-sm-2 text-right"><spring:message code="message.listForm.shuoMing"/><spring:message code="message.yanZheng.maoHao"/></label>
                          <div class="col-sm-3 text-left">
                               <c:out value="${detail.remark}" />
                          </div>
                     </div>
                     <div class="line"></div>
                     <div class="form-group form-group-xs">
                          <label class="col-sm-2 text-right"><spring:message code="message.listForm.shenHeBeiZhu"/><spring:message code="message.yanZheng.maoHao"/></label>
                          <div class="col-sm-9 text-left">
                               <textarea class="form-control" id="auditRemark" name="auditRemark" rows="3" placeholder="<spring:message code="message.listForm.shenHeBeiZhu"/>"></textarea>
                          </div>
                     </div>
                     
                     <div class="box-footer text-center">
                        <ms:btn url="/stdProdDrugInfo/approve.html"><button type="button" onclick="approve();" class="btn btn-success btn-sm"><spring:message code="message.button.auditOK"/></button></ms:btn>
                        <ms:btn url="/stdProdDrugInfo/unapprove.html"><button type="button" onclick="unapprove();" class="btn btn-success btn-sm"><spring:message code="message.button.auditNO"/></button></ms:btn>
                        <a href="${ctx}/stdProdDrugInfo/toAuditCompDrugList.html" class="btn btn-danger btn-sm"><spring:message code="message.button.getBackSpacing"/></a>
                     </div>
                </div>
            </form>
        </div>
    </section>
    <%@ include file="/WEB-INF/component/commonJS.jsp" %> 
    <script type="text/javascript">
	    function approve() {
	        $.HN.message.confirm('<spring:message code="message.yanZheng.queDingShenHeTongGuoMa"/>','','').on(function (e) {
	            if (e) {
	            	$.post("${ctx}/stdProdDrugInfo/approve.html", {
	            		"prodId" : "${detail.prodId}"
	            	}, function(result) {
	            		if (result.success) {
                            $.alert("<spring:message code="message.HN.alert.shenHeTongGuoSuccess"/><spring:message code="message.yanZheng.ganTanHao"/>", "success", function() {
                                document.location = "${ctx}/stdProdDrugInfo/toAuditCompDrugList.html";
                            });
                        } else {
                            $.alert(result.msg || "<spring:message code="message.HN.alert.shenHeBuTongGuo"/>", "error");
                        }
	            	}, "json");
	            }
	        });
	    }
	    
	    function unapprove() {
	    	var auditRemark = $.trim($("#auditRemark").val());
	    	
	    	if (auditRemark == null || auditRemark == "") {
	    		$.alert("<spring:message code="message.HN.alert.qingShuRuShenHeBeiZhu"/><spring:message code="message.yanZheng.ganTanHao"/>", "warn");
	    		return;
	    	}
	    	
            $.HN.message.confirm('<spring:message code="message.HN.alert.queDingShenHeBuTongGuoMa"/>','','').on(function (e) {
                if (e) {
                    $.post("${ctx}/stdProdDrugInfo/unapprove.html", {
                        "prodId" : "${detail.prodId}",
                        "auditRemark" : auditRemark
                    }, function(result) {
                        if (result.success) {
                            $.alert("<spring:message code="message.HN.alert.shenHeBuTongGuoSuccess"/><spring:message code="message.yanZheng.ganTanHao"/>", "success", function() {
                                document.location = "${ctx}/stdProdDrugInfo/toAuditCompDrugList.html";
                            });
                        } else {
                            $.alert(result.msg || "<spring:message code="message.HN.alert.shenHeBuTongGuoFail"/>", "error");
                        }
                    }, "json");
                }
            });
        }
    </script>
</body>
</html>